/* eslint-disable no-param-reassign */
import verifyApi from '@/api/modules/system/verify'
const initQueryParams = {
  relName: '',
  actionStatus: 'dsh'
}
const state = {
  // 列表查询条件
  queryParams: { ...initQueryParams }
}

const mutations = {
  resetVerifyEcuQueryParams (state) {
    state.queryParams = { ...initQueryParams }
  }
}

const actions = {
  // 审核通过或驳回
  // eslint-disable-next-line no-unused-vars
  editVerifyStateData ({ commit }, data) {
    return new Promise((resolve, reject) => {
      verifyApi.editAuditState(data).then(res => {
        resolve(res)
      }).catch(err => {
        reject(err)
      })
    })
  },
  // 获取审核详情
  // eslint-disable-next-line no-unused-vars
  getVerifyInfoData ({ commit }, data) {
    return new Promise((resolve, reject) => {
      verifyApi.getVerifyInfoDetail(data).then(res => {
        resolve(res)
      }).catch(err => {
        reject(err)
      })
    })
  }
}

export default {
  state,
  mutations,
  actions
}
